import React from 'react';
import ReactDOM from 'react-dom';

const toastRoot = document.getElementById('toast-root');

function Toast({ message }) {
  return ReactDOM.createPortal(
    <div className="toast">{message}</div>,
    toastRoot
  );
}

export default Toast;
